﻿using CID.Execution.Support.Information;
using CID.Execution.Support.PackageHandling;

namespace CID.Execution.Agent.Tests.Support
{
    class PackageHandlerStub : IPackageHandler
    {
        public static bool PrepareForUsageCalled { get; private set; }
        public static bool ReleaseCalled { get; private set; }

        public static void ClearFlags()
        {
            PrepareForUsageCalled = ReleaseCalled = false;
        }

        static PackageHandlerStub()
        {
            ClearFlags();
        }

        public IPackageHandlingToken PrepareForUsage(PackageInfo packageInfo)
        {
            PrepareForUsageCalled = true;
            return new PackageHandlingTokenStub();
        }

        public void Release(IPackageHandlingToken packageHandlingToken)
        {
            ReleaseCalled = true;
        }
    }
}
